package com.tarena.backing.converter;

import com.tarena.backing.pojo.param.UserParam;
import com.tarena.backing.pojo.po.User;
import com.tarena.backing.pojo.vo.UserVo;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserConverter {
    public User convertParamToModel(UserParam source) {
        if (source == null) {
            return null;
        }
        User target = new User();
        BeanUtils.copyProperties(source, target);
        return target;

        }
    public UserVo convertParamToVo(User source) {
        if (source == null) {
            return null;
        }
        UserVo target = new UserVo();
        BeanUtils.copyProperties(source, target);
        return target;

    }
    }